package com.cgc.shop.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Account entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "account")
public class Account implements java.io.Serializable {

	// Fields

	private Integer id;
	private String loginName;
	private String name;
	private String pass;
	//private Set categories = new HashSet(0);

	// Constructors

	@Override
	public String toString() {
		return "Account [id=" + id + ", loginName=" + loginName + ", name="
				+ name + ", pass=" + pass + ", categories=" + "]";
	}

	/** default constructor */
	public Account() {
	}

	/** full constructor */
	public Account(String loginName, String name, String pass, Set categories) {
		this.loginName = loginName;
		this.name = name;
		this.pass = pass;
		//this.categories = categories;
	}
	
	public Account(Integer id, String loginName, String name, String pass, Set categories) {
		this.id = id;
		this.loginName = loginName;
		this.name = name;
		this.pass = pass;
		//this.categories = categories;
	}
	
	public Account(Integer id) {
		this.id = id;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "loginName", length = 20)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}
	
	@Column(name = "name", length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "pass", length = 20)
	public String getPass() {
		return this.pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	/*@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "account")
	public Set getCategories() {
		return this.categories;
	}
	
	public void setCategories(Set categories) {
		this.categories = categories;
	}*/

}